<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%><%@ page import = "api.Search" %><%@ page import = "api.Item" %>

<%@ page import = "java.net.*"%>
<%@ page import = "java.util.ArrayList" %>
<%@ page import = "java.util.StringTokenizer" %>
<%
	request.setCharacterEncoding("UTF-8");
%>
<%!String query = null;%>
<%
	//	request.setCharacterEncoding("UTF-8");
 	query = request.getParameter("query");
 	String dQuery = URLDecoder.decode(query, "EUC-KR");
 	String eQuery =URLEncoder.encode(query, "UTF-8");

	Search search = new Search();
	search.sendRequest(eQuery);
	ArrayList<Item> dataList = new ArrayList<Item>();
	dataList = search.dataList;
%>
<table border="2.5">
	<tr>
	<%for (Item item : dataList) { %>
		<td> <%=item.title %></td>
		<td> <a href="<%=item.link%>">사러가기</a></td>
		<td>최저가 : <%=item.lprice %></td>
		<td><img src="<%=item.image %>" height="100"></td>
		
	</tr>
	<%} dataList.clear(); %>
	
</table>
